|
This page last changed on Oct 12, 2010 by brent.
This is the documentation to detail out the design of the state representation interface between the GUI application and the instrument itself. This interface will allow the GUI (and other applications) to get information about the current state of the various components of the ESP.
Some details about the interface:
- The ESP application (server) shall listen on a fixed TCP socket.
- Any number clients can connect to this socket, each thereby opening a separate, private, bidirectional, ASCII connection to the ESP server.
- The server will respond to the following client commands:
- List all available states
- Each state is identified by a short symbolic (ASCII) name.
- Retrieve metadata for subset of those states and subscribe to them
- Elements in lists of states are separated with commas
- There is no whitespace between list elements
- The order of the elements in state lists determine the ordering in reporting state vectors described below.
- Metadata shall include:
- Description e.g. Storage carousel
- sprintf format string e.g. %.2fml
- range (min and max expected values)
 | hardware failures may cause reported values to be out of range |
- map of sybolically labeled positions, each on a line of this format:
- Subscribe to updates on (only) the specified states
 | This limits subsequent state updates to just those listed by their symbolic names. This message also determines the ordering of states in vectors described below. |
- Refresh all subscribed states
 | All the subscribed states are sent to the client in the order in which they were listed in the most recent subscribe or retrieve metadata message.
where n is the number of states subscribed. This establishes a baseline from which subsequent state changes are reported. |
- Request C more changed state updates at maximum rate one per t tenths of seconds.
 |
- The client tells the server it is ready to receive C more state change responses and that the server may emit these at a rate no faster than one every t tenths of a second.
- A client wishing to continuously monitor state should send a new request shortly before the last update (as allowed by the previous request) has been received. If C is kept small (say 10 or so), this mechanism will ensure that update messages don't back up on the networking queue, while avoiding paying any network latency penalty. (Similar to TCP's sliding window mechanism)
- The client can stop updates by requesting 0 more at some arbitrary rate.
- Only those states whose values changed since the last update will be sent
- Format will be a list of lines, each of the form:
where:
- index = an integer from 0 to n-1 where n is the number of subscribed states
- new value = number conforming to the state's sprintf format string (note that the unit suffix will be omitted, i.e. 0.2 not 0.2ml)
|
 | Notes for Brent Normally, all I2C messages between the Linux host and the dwarves are logged. However, this protocol will require continuous polling of all the subscribed dwarves' raw positions. Nothing else currently does anything like this (by design! . Clearly, such messages should not be logged. Further, it may be necessary to add an I2C message to the dwarf firmware that queries raw position only. The existing full status poll message returns lots of extraneous engineering info like velocity, electrical current, etc. |
|
2-Feb-2011(weekly gui meeting). There will be a keep-alive message at some interval for the case where nothing is changing in the subscribed-to states - so the dashboard can know when coms are lost with the esp. Also, still need to resolve the 'raw units' vs. 'engineering units' question. Dashboard will need to get to engineering units somehow. Brent still wants to think this thru a bit more.
3-Feb-2011 Roman pointed out that we also need to know at the dashboard when the the esp is locked up with an error. Rich discussed briefly with Brent. While it may not strictly be 'state', it is important info to communicate to users via the dashboard. Brent suggested perhaps a second socket would have the error messages (question... how would we notify the dashboard when error condition had cleared?).

Posted by rich at Feb 03, 2011 09:16
|
|
Wanted to capture here from earlier GUI meeting discussions: ESP on-board will track and provide additional state items for things like number of pucks in a tube, capacity and current volume estimate for reagent & waste bags etc. These items can only really be inferred by the ESP as it is initialized and run as there is no actually sensor measuring these 'states'.

Posted by rich at Feb 03, 2011 09:31
|
|